#ifndef _HK_28181_SERVER_H_
#define _HK_28181_SERVER_H_

#include "hk-28181-simple-struct-define.h"

bool hk_gb28181_sip_config_init(const char *pc_sip_id, const char *pc_sip_domain, const char *pc_sip_host, unsigned short us_sip_port, const char *pc_password);
bool hk_gb28181_set_media_server_cfg(const char *pc_media_ip, unsigned short us_port);
bool hk_gb28181_sip_server_start();

bool hk_gb28181_set_register_callback(on_device_register_cb p_cb_fun, void *p_user);
bool hk_gb28181_set_catalog_callback(on_device_catalog_cb p_cb_fun, void *p_user);
bool hk_gb28181_set_invite_callback(on_device_channel_invite_cb p_cb_fun, void *p_user);
bool hk_gb28181_set_device_info_callback(on_device_info_cb p_cb_fun, void *p_user);
bool hk_gb28181_set_device_status_callback(on_device_status_cb p_cb_fun, void *p_user);

bool hk_gb28181_query_device_catalog(const char *pc_dev_id);
bool hk_gb28181_query_device_deviceinfo(const char *pc_dev_id);
bool hk_gb28181_query_device_devicestatus(const char *pc_dev_id);

//pc_start_time, pc_end_time: %Y-%m-%dT%H:%M:%S eg 2025-07-18T09:00:00
bool hk_gb28181_query_device_recordinfo(const char *pc_dev_id, const char *pc_start_time, const char *pc_end_time);
bool hk_gb28181_set_recordinfo_callback(on_device_recordinfo_cb p_cb_fun, void *p_user);

enum{
    PTZ_TILT_UP = 0, //上
    PTZ_TILT_DOWN = 1,//下
    PTZ_PAN_LEFT = 2,//左
    PTZ_PAN_RIGHT = 3,//右
    PTZ_UP_LEFT = 4,//左上
    PTZ_UP_RIGHT = 5,//右上
    PTZ_DOWN_LEFT = 6,//左下
    PTZ_DOWN_RIGHT = 7,//右下
    PTZ_STOP = 8,//停止
};
bool hk_gb28181_control_device_ptz(const char *pc_dev_id, int i_ptz_cmd);
bool hk_gb28181_control_device_ptz_set_preset(const char *pc_dev_id, int i_preset);
bool hk_gb28181_control_device_ptz_goto_preset(const char *pc_dev_id, int i_preset);
bool hk_gb28181_control_device_ptz_del_preset(const char *pc_dev_id, int i_preset);
bool hk_gb28181_control_device_get_presetlist(const char *pc_dev_id);
bool hk_gb28181_set_presetlist_callback(on_device_presetlist_cb p_cb_fun, void *p_user);

bool hk_gb28181_realtime_play(const char *pc_dev_id, const char *pc_channel_id);
bool hk_gb28181_realtime_bye(const char *pc_dev_id, const char *pc_channel_id, const char *pc_call_id);

bool hk_gb28181_playback_play(const char *pc_dev_id, const char *pc_channel_id, const char *pc_start_time, const char *pc_end_time);
bool hk_gb28181_playback_pause(const char *pc_dev_id, const char *pc_channel_id, const char *pc_call_id);
bool hk_gb28181_playback_continue(const char *pc_dev_id, const char *pc_channel_id, const char *pc_call_id);
bool hk_gb28181_playback_scale(const char *pc_dev_id, const char *pc_channel_id, const char *pc_call_id, float f_scale);
bool hk_gb28181_playback_teardown(const char *pc_dev_id, const char *pc_channel_id, const char *pc_call_id);
bool hk_gb28181_playback_bye(const char *pc_dev_id, const char *pc_channel_id, const char *pc_call_id);

#endif
